﻿@using YL.Core.Entity;

@section styles{
    <link rel="stylesheet" href="~/css/bootstrap-select.min.css" />
}
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            仓库管理
            <small>盘点库存</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">仓库管理</a></li>
            <li class="active">盘点库存</li>
        </ol>
    </section>
    <section class="content">
        <form class="form-horizontal">
            <div class="box-body">
                @{
                    var mList = ViewBag.mList as List<Wms_material>;
                    foreach (var item in mList)
                    {
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-offset-2 control-label">@item.MaterialName ( @item.Unit ):</label>
                            <div class="col-sm-4">
                                <input class="form-control" v-model="m_@item.MaterialId" type="text">
                            </div>
                        </div>
                    }
                }
                <div class="box-footer">
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-4">
                            <input v-on:click="addL" class="btn btn-primary radius" type="button" value="提交">
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </section>
</div>
@section scripts{
    <script src="~/js/bootstrap-select.min.js"></script>
    <script src="~/js/defaults-zh_CN.min.js"></script>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: @Html.Raw(ViewBag.jsonObj),
            mounted: function () {
                var _self = this;
                _self.$nextTick(function () {
                    //显示active
                    _self.$refs.InventoryIndex.parentNode.parentNode.classList.add("active");
                    _self.$refs.InventoryIndex.classList.add("active");
                });
            },
            methods: {
                addL: function () {
                    var formData = this.$data;
                    yui.$axiospostform('/Inventory/AddL', formData)
                        .then(function (response) {
                            alert(response.data);
                        });
                }
            }
        });
    </script>
}